home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / dev / src / wangisrc.lha / wangi / z / wpad_library / WPP_AllocPIHandles.c < prev    next >
C/C++ Source or Header  |  1995-08-28  |  847b  |  33 lines

  1. /***************************************************************************
  2.  * WPP_AllocPIHandles.c
  3.  *
  4.  * wpad.library, Copyright ©1995 Lee Kindness.
  5.  *
  6.  * WPP_AllocPIHandles()
  7.  */
  8.  
  9. #include "wpad_global.h"
  10.  
  11. VOID __regargs WPP_AllocPIHandles( struct Pad *pad )
  12. {
  13.     struct PadItem *node;
  14.     for(node = (struct PadItem *)pad->pad_Items->lh_Head; 
  15.         node->pi_Node.ln_Succ;
  16.         node = (struct PadItem *)node->pi_Node.ln_Succ)
  17.     {
  18.         ULONG size;
  19.         size = 0;
  20.         if( node->pi_HotKey )
  21.             size = PIH_SIZE_HOTKEY;
  22.         if( node->pi_Flags & PI_FLAGS_DATATYPE )
  23.             size = PIH_SIZE_DATATYPE;
  24.         if( (node->pi_Flags & PI_FLAGS_WBMENU) ||
  25.             (node->pi_Flags & PI_FLAGS_APPICON) )
  26.             size = PIH_SIZE_APP;
  27.         Printf("node \"%s\" size %ld\n", node->pi_Name, size);
  28.         if( size )
  29.             node->pi_Handles = AllocVec(size, MEMF_CLEAR);
  30.         else
  31.             node->pi_Handles = NULL;
  32.     }
  33. }